package com.yq.day30.udp1.v1;

import java.io.IOException;
import java.net.*;

/**
 * @author 3307235355@qq.com
 * @description
 * @since 2022/06/30 16:26
 */
public class Demo01 {
    public static void main(String[] args) throws IOException {
        DatagramSocket datagramSocket = new DatagramSocket(8888);
        String s = "666";
        byte[] bytes = s.getBytes();
        InetAddress byName = InetAddress.getByName("127.0.0.1");
        // InetAddress byName = InetAddress.getByName("192168.13.75");
        int port = 9999;
        DatagramPacket datagramPacket = new DatagramPacket(bytes, 0, bytes.length, byName, port);
        datagramSocket.send(datagramPacket);
        datagramSocket.close();





    }


}